#include<stdio.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<unistd.h>
#include<pthread.h>

//function 
void *thread_run(void* arg)
{
  while(1)
  {
    printf("test id: %p\n",pthread_self());
    sleep(1);
  }
  //printf("%s, %lu, pid:%d\n",(char*)arg,pthread_self(),getpid());
  //sleep(5);
  // return (void*)10;
  //exit(10);
}
int main()
{
  pthread_t tid;
  pthread_create(&tid, NULL, thread_run, NULL);
  while(1){
    printf("main :%p, pid %d\n", pthread_self(), getpid());
    sleep(2);
  }
  void* ret = NULL;
  pthread_join(tid,&ret);
  //printf("thread quit code : %d \n", (long long)ret);
  return 0;
}
